﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Drawing;
using System.Runtime.Serialization.Formatters.Binary;

namespace aoprinter.Model
{
    [Serializable]
    public class CloneObject<T> where T : class,new()
    {
        static public SizeF AutoSize = SizeF.Empty;
        static public PointF ZeroPoint = new PointF(-1, -1);
        public T CloneLow()
        {
            return this.MemberwiseClone() as T;
        }
        public T CloneDeep()
        {
            MemoryStream memerySteam = new MemoryStream();
            BinaryFormatter formater = new BinaryFormatter();
            formater.Serialize(memerySteam, this);
            memerySteam.Position = 0;
            return formater.Deserialize(memerySteam) as T;
        }
    }
}
